<?php

namespace App\Http\Controllers\Admin;

use App\Model\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class IndexController extends Controller
{
    public function index(Request $request)
    {
        $admin = Admin::orderBy('id', 'desc');

        if ($request->get('name')) {
            $admin->where('name', '=', $request->get('name'));
        }
        $admin= $admin->paginate(15);
        return view('admin/index/index', ['admin' => $admin]);
    }
    public function show($id)
    {
        return $id;
    }
}
